package com.lx;

import com.lx.bean.DemoProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Hello world!
 *
 */
@Configuration
@ComponentScan("com.lx")
// 指定该属性类加载到IOC容器
@EnableConfigurationProperties(DemoProperties.class)
// 当 enable 存在且为true时加载配置
@ConditionalOnProperty(prefix = "demo", name = "enable")

/*
application.yml
    demo:
        enable: true
        name:
 */
public class App 
{

}
